import request from '../../utils/request'


/**
 * 增加客户代理协议
 * @param params
 * @returns {Promise.<void>}
 */
export async function addAgencyagreement(params) {
    return request(apiPath.mc + "/api/customer/agencyagreement", {
        method: 'post',
        data: params
    });
}


/**
 * 增加客户代理协议
 * @param params
 * @returns {Promise.<void>}
 */
export async function updateAgencyagreement(params) {
    return request(apiPath.mc + "/api/customer/agencyagreement", {
        method: 'put',
        data: params
    });
}

/**
 * 获取客户代理协议
 * @param id
 * @returns {Promise.<void>}
 */
export async function getAgencyagreementById({id}) {
    return request(apiPath.mc + "/api/customer/agencyagreement/" + id, {
        method: 'get',
    });
}


/**
 * 删除客户代理协议
 * @param id
 * @returns {Promise.<void>}
 */
export async function deleteAgencyagreementById({id}) {
    return request(apiPath.mc + "/api/customer/agencyagreement/"+ id, {
        method: 'delete',
    });
}

/**
 *获取除客户代理协议列表
 * @param id
 * @param page
 * @returns {Promise.<void>}
 */
export async function getAgencyagreementList({id, page}) {
    return request(apiPath.mc + "/api/customer/"+ id +"/agencyagreements", {
        method: 'get',
        data: {page: page.page, size: page.size}
    });
}